const _wx = require('utils/util.js');
App({
  onLaunch() {
    var _this = this;
     
    //自定义导航栏 获取设备顶部窗口的高度（不同设备窗口高度不一样，根据这个来设置自定义导航栏的高度）
    wx.getSystemInfo({
      success: (res) => {
        let custom = wx.getMenuButtonBoundingClientRect()
        _this.globalData.statusBarHeight = res.statusBarHeight
        _this.globalData.navBarHeight = custom.height + (custom.top - res.statusBarHeight) * 2
      }
    })
  },
  onShow (options) {
    wx.onAppRoute((res) => {
      // console.log(res)
      return
      if(res.path != 'pages/about/about'){
        _wx.getData('admin/login/getmenu', 'GET', {
        }, function (res) {
          if (res.code == 0) {
          }
        });
        _wx.getData('admin/login/permission', 'GET', {
        }, function (res) {
          if (res.code == 0) {
          }
        });
      }
      console.log('路由跳转')
    })
  },
  
  globalData: {
    statusBarHeight: 0,
    navBarHeight: 0,
  }
})
